-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Packager] Add option for remote packager in info.plist #548
Conversation
@frantic can you take a look? |
|
@tobyhughes - if you are still interested in working on that, please consider @brentvatne's suggestions about code style and docs. Potentially (in separate PR) we could also provide a script that at build time writes laptop's IP address into Info.plist to make everything "just work". |
Will do :) I'll update the PR tonight. |
Just looked at the codebase, and seems like there are few more places where the URL is hardcoded. Would be nice to change those refs too:
You can also extract this logic into some util function to not have to do this manually in different places, something like |
Could you generalize this so it's programmatically configurable and reads from the Info.plist by default but doesn't require it? Ex: |
cc @nicklockwood - were you planning on adding this to the dev menu? would be nice to move what we have internally to OSS with the bonjour stuff and app link support (rn://ip:X.X.X.X) |
Is there any way I can help with this? I've got to debug on device because my app uses the camera, and this stuff is a pain. |
{ | ||
NSString *url = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"ReactServer"]; | ||
|
||
if (url == nil){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: space after )
I'm getting this in shortly :) |
Yeah, this isn't the right right way to handle URLs in iOS. You should probably do something like:
Although that also isn't completely bulletproof. Probably worth writing some unit tests with various combinations of missing or redundant prefixes and suffixes. It may be worth using |
@nicklockwood has a great point |
@tobyhughes - any interest in updating this or can we close? |
* Align some more of the publish/pr logic on android builds * minor fix Co-authored-by: Andrew Coates <acoates-ms@noreply.github.com>
Add an option to add a
ReactServer
key to info.plist that specifies a location to a remote server running the packager. This allows you to easily change the location of the packager for on-device debugging without having to root around in various parts of the code, namely AppDelegate.m and RCTWebSocketExecutor.m (if you want debugging).